/**
 * Shared Bridge Types
 *
 * These types define common interfaces for both HAP and Matter bridges
 * to ensure consistency across bridge implementations.
 */

/**
 * Base bridge status states
 * These are the common states shared by all bridge types
 */
export type BridgeStatus = 'pending' | 'ok' | 'down'

/**
 * Base bridge metadata interface
 * All bridge types (HAP, Matter) extend this interface
 */
export interface BaseBridgeMetadata {
  /** Bridge type identifier (hap or matter) */
  type: 'hap' | 'matter'
  /** Current operational status */
  status: BridgeStatus
  /** Bridge username (MAC address for HAP, identifier for Matter) */
  username?: string
  /** Bridge port number */
  port?: number
  /** Display name of the bridge */
  name: string
  /** Plugin identifier that owns this bridge */
  plugin: string
  /** Unique identifier for this bridge instance */
  identifier: string
  /** Whether the bridge was manually stopped */
  manuallyStopped?: boolean
  /** Process ID of the bridge if running as child process */
  pid?: number
}

/**
 * Base commissioning information interface
 * Contains pairing/commissioning details for bridges
 */
export interface BaseCommissioningInfo {
  /** Bridge type (hap or matter) */
  type?: 'hap' | 'matter'
  /** Setup URI/QR code for pairing */
  setupUri?: string | null
  /** PIN/pairing code */
  pin?: string | null
  /** Device serial number */
  serialNumber?: string
  /** Whether the bridge has been paired/commissioned */
  commissioned?: boolean
  /** Port number if applicable */
  port?: number
}
